using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter18
{
	/// <summary>
	/// Example07: Measuring the Frequency of a Tuning Fork
	/// A simple apparatus for demonstrating resonance in an
	/// air column is depicted. A vertical pipe open at both
	/// ends is partially submerged in water, and a tuning fork
	/// vibrating at an unknown frequency is placed near the top
	/// of the pipe. The length L of the air column can be adjusted
	/// by moving the pipe vertically. The sound waves generated by
	/// the fork are reinforced when L corresponds to one of the
	/// resonance frequencies of the pipe.
	/// For a certain pipe, the smallest value of L for which a peak
	/// occurs in the sound intensity is 9.00 cm. What are
	/// (A) the frequency of the tuning fork.
	/// f_1 = 953 Hz
	/// (B) the values of L for the next two resonance frequencies?
	/// L = 0.27 m
	/// L = 0.45 m.
	/// </summary>
	public class Example07
	{
		public Example07()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			double v = 343.0;
			double L = 0.09;
			//(A)
			// v = lambda_1*f_1
			// lambda_1 = 4*L
			// f_1 = v/4/L
			double f1 = v/4.0/L;
			result+=Convert.ToString(f1)+"\r\n";
			//(B)
			// v = lambda_n*f1
			// lambda_n = 4*L, 4*L/3, 4*L/5
			// L = lambda/4(=0.09), lambda/4*3, lambda/4*5
			result+=Convert.ToString(L*3)+"\r\n";      
			result+=Convert.ToString(L*5)+"\r\n";  		
		}
	}
}
